import req from '@/utils/request'

const getCateList$ = () => req({method: 'get', url:'/my/cate/list'})// 获取分类列表
const add$ = data => req({method: 'post', url:'/my/cate/add', data})// 新增分类
const update$ = data => req({method: 'put', url:'/my/cate/info', data})// 修改分类
const delete$ = id => req({method: 'delete', url:'/my/cate/del', params:{id}}) // 删除分类

const artGetList$ = params => req.get('/my/article/list', {params})
const artAdd$ = data => req.post('/my/article/add', data)
const artGetDetail$ = id => req.get('/my/article/info', {params: { id }})
const artEdit$ = data => req.put('/my/article/info', data)
const artDel$ = id => req.delete('/my/article/info', { params: { id } })

export { 
    getCateList$, add$, update$, delete$,// 分类接口
    artGetList$,artAdd$,artGetDetail$,artEdit$,artDel$ // 文章接口
 }